<!doctype html>
<html lang="en" dir="ltr">
<?php
include('../confing/common.php');
?>
<head>
    <meta charset="UTF-8">
    <title>笨笨狗</title>
    <link rel="stylesheet" href="../assets/login/style.css">
    <link rel="stylesheet" href="../assets/layui/css/layui.css"/>
</head>
<body>
     <!--partial:index.partial.html -->
    <!DOCTYPE html>
    <html lang="es" dir="ltr">
    <head>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
        <meta charset="utf-8">
        <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap" rel="stylesheet">
    </head>
    <body>
        <div id="login1" class="main">
            <div class="container a-container" id="a-container">
                <form @submit.prevent="" class="form" method="post">
					<h2 class="form_title title">用户登录</h2>
					 <p class="switch__description description">本平台禁止中国大陆公民使用
</p>
					<input v-model="dl.user" class="form__input" type="text" placeholder="请输入账号">
					<input v-model="dl.pass" class="form__input" type="password" placeholder="请输入密码">
					<div @click="goReg" class="mobile-txt">还没有账号？点击注册</div>
					<button @click="login" class="form__button button">立即登录</button>
					<div class="form__icons" style="margin-bottom: 20px ;margin-top:30px;">
                    快捷登录：&nbsp;<img src="../assets/images/qq.png" style="height:38px;margin: -4px 5px 0 5px;" id="connect_qq">
                     </div>
				</form>
					<!--<div @click="goReg" class="mobile-txt">还没有账号？点击注册</div>-->
            </div>
            <div class="container b-container" id="b-container">
                <form @submit.prevent="" class="form" method="post">
					<h2 class="form_title title">用户注册</h2>
					<input v-model="reg.name" class="form__input" type="text" placeholder="请输入昵称">
				
					<input v-model="reg.user" class="form__input" type="text" placeholder="请输入账号(QQ号)">
					<input v-model="reg.pass" class="form__input" type="password" placeholder="请输入密码">
						<input v-model="reg.yqm" class="form__input" type="text" placeholder="请输入邀请码">
					<button @click="register" class="form__button button">立即注册</button>
					<div @click="goLogin" class="mobile-txt">已有账号？点击登录</div>
				</form>
            </div>
            <div class="switch" id="switch-cnt">
                <div class="switch__circle"></div>
                <div class="switch__circle switch__circle--t"></div>
                <div class="switch__container" id="switch-c1">
                    <h2 class="switch__title title">欢迎来到笨笨狗 !</h2>
                    <!--<p class="switch__description description">为人谋而不忠乎？-->
                    <!--<p>与朋友交而不信乎？</p>传不习乎？</p>-->
                     <p class="switch__description description">本平台禁止中国大陆公民使用
</p>
                    <button id="goReg" class="switch__button button switch-btn">立即注册</button>
                </div>
                <div class="switch__container is-hidden" id="switch-c2">
                    <h2 class="switch__title title">欢迎来到笨笨狗!</h2>
                    <p class="switch__description description">本平台禁止中国大陆公民使用
</p>
                    <button id="goLogin" class="switch__button button switch-btn">立即登录</button>
                    
                </div>
            </div>
        </div>
    </body>
         <div class="home-btn d-none d-sm-block">
        <a href="index.html" class="text-dark"><i class="fas fa-home h2"></i></a>
    </div>
    <!--<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=0 height=0 src="//music.163.com/outchain/player?type=2&id=1336856777&auto=1&height=66"></iframe>-->
</html>
<!-- partial -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="assets/js/fb.min.js"></script>
<script src="layer/3.1.1/layer.js"></script>
<script src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
<script>
    var vm = new Vue({
        el: "#login1",
        data: {
            loginType: true,
            title: "你在看什么呢？我写的代码好看吗",
            dl: {},
            reg: {}
        },
        methods: {
            newlogin: function() {
                this.loginType = !this.loginType
            },
            login: function() {
                if (!this.dl.user || !this.dl.pass) {
                    layer.msg('账号密码不能为空', {
                        icon: 2
                    });
                    return
                }
                var loading = layer.load(2);
                vm.$http.post("/apisub.php?act=login", {
                    user: this.dl.user,
                    pass: this.dl.pass
                }, {
                    emulateJSON: true
                }).then(function(data) {
                    layer.close(loading);
                    if (data.data.code == 1) {
                        layer.msg(data.data.msg, {
                            icon: 1
                        });
                        setTimeout(function() {
                            window.location.href = "/"
                        }, 1000);
                    } else if (data.data.code == 5) {
                        vm.login2();
                    } else {
                        layer.msg(data.data.msg, {
                            icon: 2
                        });
                    }
                });

            },
            register: function() {
                if (!this.reg.user || !this.reg.pass || !this.reg.name || !this.reg.yqm) {
                    layer.msg('所有项不能为空', {
                        icon: 2
                    });
                    return
                }
                var loading = layer.load(2);
                this.$http.post("/apisub.php?act=register", {
                    name: this.reg.name,
                    user: this.reg.user,
                    pass: this.reg.pass,
                    yqm: this.reg.yqm
                }, {
                    emulateJSON: true
                }).then(function(data) {
                    layer.close(loading);
                    if (data.data.code == 1) {
                        this.loginType = true;
                        this.dl.user = this.reg.user;
                        this.dl.pass = this.reg.pass;
                        layer.msg(data.data.msg, {
                            icon: 1
                        });
                    } else {
                        layer.msg(data.data.msg, {
                            icon: 2
                        });
                    }
                });
            },
            login2: function() {
                layer.prompt({
                    title: '管理二次验证',
                    formType: 3
                }, function(pass2, index) {
                    var loading = layer.load(2);
                    vm.$http.post("/apisub.php?act=login", {
                        user: vm.dl.user,
                        pass: vm.dl.pass,
                        pass2: pass2
                    }, {
                        emulateJSON: true
                    }).then(function(data) {
                        layer.close(loading);
                        if (data.data.code == 1) {
                            layer.msg(data.data.msg, {
                                icon: 1
                            });
                            setTimeout(function() {
                                window.location.href = "/"
                            }, 1000);
                        } else {
                            layer.msg(data.data.msg, {
                                icon: 2
                            });
                        }
                    });
                });
            },
            goLogin: function() {
                document.getElementById('goLogin').click()
            },
            goReg: function() {
                document.getElementById('goReg').click()
            }
        },
        mounted() {
        }
    });

    $('#connect_qq').click(function() {
        var ii = layer.load(0, {
            shade: [0.1, '#fff']
        });
        $.ajax({
            type: "POST",
            url: "../qq_login.php",
            data: {"type":'qq'},
            dataType: 'json',
            success: function(data) {
                layer.close(ii);
                if (data.code == 1) {
                    window.location.href = data.url;
                } else {
                    layer.alert(data.msg, {
                        icon: 7
                    });
                }
            }
        });
    });
    
</script>
<script src="../assets/login/script.js"></script>
</body>
</html>
<script>
    const handler = setInterval(function () {
  console.clear()
  const before = new Date()
  debugger
  const after = new Date()
  const cost = after.getTime() - before.getTime()
  if (cost > 100) {
  }
}, 1)
//屏蔽右键菜单
document.oncontextmenu = function (event) {
  if (window.event) {
    event = window.event
  }
  try {
    var the = event.srcElement
    if (
      !(
        (the.tagName == 'INPUT' && the.type.toLowerCase() == 'text') ||
        the.tagName == 'TEXTAREA'
      )
    ) {
      return false
    }
    return true
  } catch (e) {
    return false
  }
}
//禁止f12
function fuckyou() {
  window.open('/', '_blank') //新窗口打开页面
  window.close() //关闭当前窗口(防抽)
  window.location = 'about:blank' //将当前窗口跳转置空白页
}
//禁止Ctrl+U
var arr = [123, 17, 18]
;(document.oncontextmenu = new Function('event.returnValue=false;')), //禁用右键
  (window.onkeydown = function (e) {
    var keyCode = e.keyCode || e.which || e.charCode
    var ctrlKey = e.ctrlKey || e.metaKey
    console.log(keyCode + '--' + keyCode)
    if (ctrlKey && keyCode == 85) {
      e.preventDefault()
    }
    if (arr.indexOf(keyCode) > -1) {
      e.preventDefault()
    }
  })

</script>